//
//  LGMonitoringHistoryView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/3/6.
//  历史记录--标题

#import "LGMonitoringHistoryView.h"

@implementation LGMonitoringHistoryView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.titleLabel];
        [self addSubview:self.iconView];
        [self addSubview:self.monthLabel];
        [self addSubview:self.monthBtn];
        [self.monthLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.iconView.mas_right).offset(viewPix(12));
            make.centerY.equalTo(self.iconView);
        }];
        [self.monthBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.monthLabel.mas_right);
            make.centerY.equalTo(self.monthLabel);
            make.width.equalTo(@(viewPix(40)));
            make.height.equalTo(@(viewPix(30)));
        }];
    }
    return self;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"历史记录" colorString:@"#333333" textFont:LGFontWeight(16, UIFontWeightMedium) textAlignment:NSTextAlignmentLeft lines:1];
        _titleLabel.frame = CGRectMake(viewPix(20), viewPix(5), viewPix(100), viewPix(22));
    }
    return _titleLabel;
}

-(UIView *)iconView{
    if(!_iconView){
        _iconView = [[UIView alloc] initWithFrame:CGRectMake(viewPix(20), kMaxY(self.titleLabel.frame)+viewPix(13), viewPix(4), viewPix(14))];
        _iconView.backgroundColor = [UIColor colorWithString:@"#77D4C6"];
        _iconView.cornerRidus = 2;
    }
    return _iconView;
}

-(UILabel *)monthLabel{
    if(!_monthLabel){
        _monthLabel = [UILabel lableWithText:@"" colorString:@"#333333" textFont:LGFont(16) textAlignment:NSTextAlignmentLeft lines:1];
    }
    return _monthLabel;
}
-(UIButton *)monthBtn{
    if(!_monthBtn){
        _monthBtn = [UIButton buttonWithImage:@"grayTipDown" selectImage:@"grayTipDown"];
    }
    return _monthBtn;
}


@end
